

<!DOCTYPE html>
<html>
<head>
    <head>
        <meta charset="UTF-8">
        <title>狗东购物商城！</title>
        <meta name="description" content="狗东毕业设计商城，为您提供愉悦的网上购物体验!" />
    	<meta name="Keywords" content="网上购物,网上商城,手机,笔记本,电脑,MP3,CD,VCD,DV,相机,数码,配件,手表,存储卡,京东" />
        <style type="text/css">
            @import url(../static/detail/css/normalize.css);
            @import url(../static/detail/css/base.css);
            @import url(../static/detail/css/detail.css);
            @import url(../static/index/css/footer.css);
        </style>
        <script src="../static/detail/js/jquery.min.js"></script>
        <script src="../static/detail/js/base.js"></script>
        <script src="../static/detail/js/detail.js"></script>
    </head>



</head>
<link rel="stylesheet" type="text/css" href="../../static/order/css/style.css">
<body>
<div class="shortcut">
    <div class="w">
        <!--        首页加位置-->
        <ul class="fl">
            <li id="ttbar-home"><i class="iconfont">&#xe608;</i><a href="/index" target="_blank">狗东首页</a></li>
            <li class="dorpdown" id="ttbar-mycity"></li>
        </ul>
    </div>
    <ul class="fr nav">
        <#if user?exists>
            <li>
                <a href="/userInfo" style="color: #c81623">${user}</a>
                ${warning}
            </li>
            <li class="space"></li>
            <li>
                <a href="/order/all">我的订单</a>
            </li>
            <li class="space"></li>
            <li>
                <a href="/userInfo">我的狗东</a>
            </li>
        <#else>
            <li>
                <a href="/login">你好，请登录</a>
                <a href="/register" class="f10">免费注册</a>
            </li>
        </#if>
        <li class="space"></li>
    </ul>
</div>
</div>

<div class="m">
    <div class="w middle">
        <div class="form">
            <form action="/find/name" method="post">
                <input id="text" type="text" name="name" placeholder="搜索">
                <button><input type="submit" value="搜索" style="width: 50px"></button>
            </form>
        </div>
        <div class="shopCar">
            <i></i><a href="/cart" class="f10">我的购物车</a>
        </div>
        <div class="navitems">
            <ul>
                <li><a href="">秒杀</a></li>
                <li><a href="">服装</a></li>
                <li><a href="#">水果</a></li>
                <li><a href="#">书籍</a></li>
                <li><a href="#">医疗用品</a></li>
                <li><a href="#">数码产品</a></li>
                <li><a href="#">食品</a></li>
                <li><a href="#">电器</a></li>
                <li><a href="#">日常用具</a></li>
                <li><a href="#">其他</a></li>
                <li class="space"></li>
            </ul>
        </div>
    </div>
</div>


<div class="de_container">
            <div class="w">
                <div class="crumb_wrap">
                    <a href="#">${product.product.kind}</a>
                    <a href="#">${product.product.name}</a>
                </div>
                <div class="product_intro">
                    <div class="preview_wrap fl">
                        <div class="preview_img">
                            <img src="../upload/${product.product.photo}" width="100%" alt="">
                            <div class="mask"></div>
                            <div class="big">
                                <img src="../upload/${product.product.photo}" width="800px" alt="" class="bigimg">
                            </div>
                        </div>
                        <div class="preview_list">
                            <a href="javascript:;" class="arrow_prev"><</a>
                            <a href="javascript:;" class="arrow_next">></a>
                            <ul class="list_item">
                                <li class="current"><img src="../upload/${product.product.photo}" alt="" width="56px"></li>

                                <li><img src="../upload/${product.product.photo}" alt="" width="56px"></li>
                                <li><img src="../upload/${product.product.photo1}" alt="" width="56px"></li>
                                <li><img src="../upload/${product.product.photo2}" alt="" width="56px"></li>
                                <li><img src="../upload/${product.product.photo3}" alt="" width="56px"></li>
                                <li><img src="../upload/${product.product.photo4}" alt="" width="56px"></li>
                            </ul>
                        </div>
                    </div>
                    <div class="itemInfo_wrap fr">
                        <div class="sku_name">
                            【限量秒杀】${product.product.name}
                        </div>

                                <div class="sk_goods_progress">
                                    <div class="curTime">
                                        <span id="nowTime"></span>
                                    </div>
                                    <em><span id="laterNumber"></span></em>
                                </div>


                        <div class="summary">
                            <dl class="summary_price">
                                <dt>秒杀价</dt>
                                <dd>
                                    <i class="price">¥${product.seckillProduct.price?c}</i>
                                    <div class="remark">累计评价${all}</div>
                                </dd>
                            </dl>
                            <dl class="summary_promotion">
                                <dt>原价</dt>
                                <dd>
                                    ￥${product.product.price}
                                </dd>
                            </dl>

                            <dl class="summary_stock">
                                <dt>配送至</dt>
                                <dd>
                                    ${consumer.address}
                                    <br>卖家准时发货
                                </dd>
                            </dl>
                            <dl class="summary_stock">
                                <dt>库存</dt>
                                <dd>
                                    ${product.seckillProduct.number}
                                </dd>
                            </dl>

                            <dl class="summary_stock">
                                <dt>已售</dt>
                                <dd>
                                    ${start.number-product.seckillProduct.number}
                                </dd>
                            </dl>

                            <dl class="summary_stock">
                                <dt>店铺</dt>
                                <dd>
                                    ${shop.name}&nbsp;&nbsp;<a href="/chat?shopId=${shop.id}">联系商家</a>
                                </dd>
                            </dl>

                            <dl class="choose_color">
                                <dt>选择颜色</dt>
                                <dd>
                                    <#list color as c>
                                        <a href="javasript:;">${c}</a>
                                    </#list>
                                </dd>
                            </dl>

                            <div class="choose_btns">

                                <a href="/addCart?productId=${product.product.id?c}&shopId=${product.product.shopId?c}" class="addCar">加入购物车</a>&nbsp&nbsp&nbsp&nbsp
                                <#if product.seckillProduct=0>
                                    <a href="" class="addCar">不可购买</a>
                                    <#else>

                                        <button id="b"  onclick="a()" class="buyBtn" disabled="true" value="立即抢购"></button>
                                </#if>

                            </div>
                            </br>
                            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                            ${message}
                        </div>

                    </div>

                </div>
                <div class="product_detail">
                    <div class="aside fl">
                        <div class="tab_list">
                            <ul>
                                <li class="first_tab current">推荐</li>
                                <li class="second_tab">品牌</li>
                            </ul>
                        </div>
                        <div class="tab_con">
                            <ul>
    <#--                            //商品过少不能用商品推荐-->
                                <#if random8.name?exists>
                                    <li>
                                        <img src="../upload/${random1.photo}" width="100%" alt="">
                                        <h5>${random1.name}</h5>
                                        <div class="aside_price">${random1.price?c}</div>
                                        <a href="/addCart" class="as_addcar">加入购物车</a>
                                    </li>
                                <li>
                                    <img src="../upload/${random2.photo}" width="100%" alt="">
                                    <h5>${random2.name}</h5>
                                    <div class="aside_price">${random2.price?c}</div>
                                    <a href="/addCart" class="as_addcar">加入购物车</a>
                                </li>
                                    <img src="../upload/${random3.photo}" width="100%" alt="">
                                    <h5>${random3.name}</h5>
                                    <div class="aside_price">${random3.price?c}</div>
                                    <a href="/addCart" class="as_addcar">加入购物车</a>
                                </li>
                                <li>
                                    <img src="../upload/${random4.photo}" width="100%" alt="">
                                    <h5>${random4.name}</h5>
                                    <div class="aside_price">${random4.price?c}</div>
                                    <a href="/addCart" class="as_addcar">加入购物车</a>
                                </li>
                                <li>
                                    <img src="../upload/${random5.photo}" width="100%" alt="">
                                    <h5>${random5.name}</h5>
                                    <div class="aside_price">${random5.price?c}</div>
                                    <a href="/addCart" class="as_addcar">加入购物车</a>
                                </li>
                                <li>
                                    <img src="../upload/${random6.photo}" width="100%" alt="">
                                    <h5>${random6.name}</h5>
                                    <div class="aside_price">${random6.price?c}</div>
                                    <a href="/addCart" class="as_addcar">加入购物车</a>
                                </li>
                                </#if>

                            </ul>
                        </div>
                    </div>
                    <div class="detail fr">
                        <div class="detail_tab_list">
                            <ul>
                                <li class="current">商品介绍</li>
                                <li>商品评价（${all}）</li>
                            </ul>
                        </div>
                        <div class="detail_tab_con">
                            <div class="item">
                                <ul class="item_info">
                                    <li>商品名称：${product.product.name}</li>
                                    <li>商品描述：${product.product.describes}</li>
                                </ul>
                                <img src="../upload/${product.product.descPhoto1}" alt="">
                                <img src="../upload/${product.product.descPhoto2}" alt="">
                                <img src="../upload/${product.product.descPhoto3}" alt="">
                                <img src="../upload/${product.product.descPhoto4}" alt="">
                                <img src="../upload/${product.product.descPhoto5}" alt="">
                            </div>
                            <div class="item">
                                <div class="rate">
                                    <div class="rate-l fl">
                                        <strong>${avg}<span></span></strong><br><span>评分</span>
                                    </div>
                                </div>
                                <div class="comment-info">
                                    <a href="#">全部评价 (${all})</a>
                                    <a href="#">好评 (${goodSize})</a>
                                    <a href="#">中评 (${centreSize})</a>
                                    <a href="#">差评 (${badSize})</a>
                                </div>

                                <ul class="comment-main">
                                    <#list evaluates as evaluate>
                                        <li>
                                            <a href="#"></a>
                                            <div class="comment-main-r">
                                                <div class="main-top">
                                                    *${evaluate.consumerName?substring(1,2)}** (匿名) 评分:${evaluate.level} &nbsp;&nbsp;${evaluate.date}
                                                </div>
                                                <div class="main-bd">
                                                    ${evaluate.content}<br />
                                                </div>
                                            </div>
                                        </li>
                                    </#list>


                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>

<bodyfooter>
    <div class="footer">
        <div class="alt">
            <div class="foot">
                <p>关于作者</p>
                <a href="###">冯东旺</a>
                <a href="###">外包171</a>
                <a href="###">广药</a>
                <a href="###">2021届</a>
                <a href="###">毕业设计</a>
                <a href="###">SpringCloud</a>
                <a href="###">电商平台</a>

            </div>
            <div class="foot">
                <p>资源</p>
                <a href="###">生产者代码</a>
                <a href="###">消费者代码</a>
                <a href="###">注册中心代码</a>
                <a href="###">控制代码</a>
            </div>
            <div class="foot">
                <p>产品介绍</p>
                <a href="###">使用教程</a>
                <a href="###">产品思路</a>
            </div>
            <div class="foot">
                <p>友情链接</p>
                <a href="###">Eureka注册中心</a>
                <a href="###">商家管理中心</a>
                <a href="###">资源占用查看</a>
            </div>
            <div class="foot">
                <p>反馈</p>
                <a >作者邮箱：fdw_fdw@qq.com</a>
            </div>
            <div class="foot">
                <p>服务支持</p>
                <a href="###">gitee下载链接</a>
            </div>
            <div class="foot">
                <p>打赏作者</p>
                <img src="../static/index/pay_photo/wechat.jpg" width="128px" height="150px"/>
            </div>
            <div class="foot">
                <p> </p>
                <img src="../static/index/pay_photo/alipay.jpg" width="128px" height="150px"/>
            </div>
        </div>
        <div style="border-top:1px #1F1F1F solid;">
            <p class="alt" style="color:#999; line-height:0;">@ 开放协议：GPL    
                <span>作者：</span>
                <a href="###" target="_blank" style="color:#999;">冯东旺</a>
                <span style="float:right;">地址：广州大学城广药</span>
            </p>
        </div>
    </div>
</bodyfooter>



<script type="text/javascript">
    $(document).read(function (){
        const url="/cart"
        $('.btn').click(function (){
            $.ajax({
                url:url,
                type:"GET",
                param:id,
                success: function (result){
                    console.assert(result);
                },
                error:function (error){
                    console.log('Error ${error}')
                }
            })
        })

    })

    function cho_number(){
        var number=cho_number.value();
        return number;
    }

    <script type="text/javascript">
      function cho_number(){
          var number=cho_number.value();
          return number;
      }
    </script>

    <script>
        window.onload = function(){
            setInterval(FreeTime,1000);
            setInterval(FreeTime2,1000);
        }
        function FreeTime(){
            var curTime = Date.now();
            var endTime = new Date("${product.seckillProduct.dateEnd}");
            var startTime=new Date("${product.seckillProduct.dateStart}");
            var allFreeSeconds = (endTime-curTime)/1000;
            var go2=(curTime-startTime)/1000;
            if(go2<0){
                var allFreeSeconds1 = -(curTime-startTime)/1000;
                var freeDay1 = Math.floor(allFreeSeconds1 / (24 * 60 * 60));
                var freeHour1 = Math.floor(allFreeSeconds1 / (60 * 60) % 24);
                var freeMinute1 = Math.floor(allFreeSeconds1 / 60 % 60);
                var freeSecond1 = Math.floor(allFreeSeconds1 % 60);
                document.getElementById("nowTime").innerHTML = freeDay1 + "天" + freeHour1 + "时" + freeMinute1 + "分" + freeSecond1 + "秒"+"后开始";
            }else {
                if (allFreeSeconds < 0) {
                    document.getElementById('nowTime').innerHTML = "活动已经结束";
                } else {
                    var freeDay = Math.floor(allFreeSeconds / (24 * 60 * 60));
                    var freeHour = Math.floor(allFreeSeconds / (60 * 60) % 24);
                    var freeMinute = Math.floor(allFreeSeconds / 60 % 60);
                    var freeSecond = Math.floor(allFreeSeconds % 60);
                    document.getElementById("nowTime").innerHTML = "剩余" + freeDay + "天" + freeHour + "时" + freeMinute + "分" + freeSecond + "秒";
                    document.getElementById('laterNumber').innerHTML = "仅剩${product.seckillProduct.number}件";
                }
            }
        }

    </script>
    <script>
        // window.onload = function(){
        //     setInterval(FreeTime2,1000);
        // }

        function FreeTime2(){
            var curTime2 = Date.now();
            var endTime2 = new Date("${product.seckillProduct.dateEnd}");
            var startTime2=new Date("${product.seckillProduct.dateStart}");
            var allFreeSeconds2 = (endTime2-curTime2)/1000;
            var go2=(curTime2-startTime2)/1000;
            if(go2<0){
                document.getElementById('b').innerHTML = "活动没开始";

            }else {
                if (allFreeSeconds2 < 0) {
                    document.getElementById('b').disabled = true;
                    document.getElementById('b').innerHTML = "活动已经结束";
                } else {
                    document.getElementById('b').disabled = false;
                    document.getElementById("b").innerHTML = "立即抢购";
                }
            }
        }
    </script>

    <script>
        // 测试
        function a(){
            window.open("http://localhost:7001/secKill/buy?productId=${product.product.id?c}&price=${product.seckillProduct.price?c}")
        }
    </script>
</script>
</html>